"""
@Project ：HaloInterfaceProject 
@File    ：GetUserRoles.py
@IDE     ：PyCharm 
@Author  ：张成龙
@Date    ：2024/10/24 16:49 
@explain ：获取用户角色
"""
import requests

from api import SYSTEM_URL, SESSION


class GetUserRoles:

    def __init__(self):
        self.url = SYSTEM_URL + "/api/v1alpha1/roles?page=0&size=0&labelSelector=%21halo.run%2Frole-template"
        self.headers = {
            'Cookie': SESSION
        }

    def get_user_roles(self):

        response = requests.get(self.url, headers=self.headers)
        return response
